
public class Domino implements Scorable
{
    private int _left;
    private int _right;
    
    /**
     * Constructor: Sets the right and left 
     * sides of the domino.
     */
    public Domino(int left, int right)
    {
       _left = left;
       _right = right;
    }
    
    
    /**
     * @return the right side of the domino
     */
    public int getRight()
    {
        return _right;
    }
    
    
    /**
     * @return the left side of the domino
     */
    public int getLeft()
    {
        return _left;
    }
    
    
    /**
     * Flips the right and left side of the domino. 
     * Left becomes right, right becomes left.
     */
    public void rotate()
    {
        //Yes this really works
        _right = _right + left;
        _left = _right - left;
        _right = _right - left;
    }
    
    
    /**
     * @return the score of the domino. (The sum of the left and right pips.)
     */
    public int getScore()
    {
        return _right + _left;
    }
}


